angular.module('myModule', ['ui.bootstrap'])

.controller('SignUpCtrl', function($scope) {
   
    });

function ArtCtrl($scope,$http){
	$http.get('app/artData/artwork.json').success(
	function(data){
		$scope.artwork = data;
	}
  	 );

	$scope.display = '';
	$scope.sort = 'title';
	$scope.order = "true";
	$scope.ascend = true;
	$scope.ascension = function(string){
		$scope.ascend = string;
	}
	$scope.orderChange = function(){
		$scope.order = $scope.order == true ? false:true;
	}
	$scope.sortChange = function(string){
		$scope.sort = string;
	};

	$scope.displayChange = function(string){
		$scope.display = string;
	};
}

function ButtonCtrl($scope) {
	$scope.radioModel = 'both';

}

var SignUpCtrl = function ($scope, $modal, $log) {

  $scope.user = {
  	name: "",
  	password: "",
  	username: ""
  };

  $scope.open = function () {

    var modalInstance = $modal.open({
      templateUrl: 'SignUp.html',
      controller: ModalInstanceCtrl,
      resolve: {
        fields: function () {
          return $scope.user;
        }
      }
    });

    modalInstance.result.then(function (user) {
      $scope.fields = user;
    }, function () {
      $log.info('Modal dismissed at: ' + new Date());
    });
  };
};
var ModalInstanceCtrl = function ($scope, $modalInstance, fields) {

  $scope.userCreation = fields;
 
  $scope.ok = function () {
    $modalInstance.close($scope.userCreation);
  };

  $scope.cancel = function () {
    $modalInstance.dismiss('cancel');
  };
}; 

 

function CarouselCtrl($scope){
	var slides = $scope.slides = [{'image':'pictures/Fennekin.png','name':'Fennekin','text':'Fire starter'},
	{'image':'pictures/Malamar.png','name':'Malamar','text':'Demon squid'},{'image':'pictures/Tyrantrum.png','name':'Tyrantrum','text':'Rocky tyranno'},
	{'image':'pictures/Yveltal.png','name':'Yveltal','text':'Utra bird'}
	];
}

function ImageCtrl($scope){
	var picture = $scope.picture = [{'image':'pictures/Fennekin.png'},{'image':'pictures/Malamar.png'},
	{'image':'pictures/Tyrantrum.png'},{'image':'pictures/Yveltal.png'},{'image':'pictures/Fennekin.png'},{'image':'pictures/Malamar.png'},
	{'image':'pictures/Tyrantrum.png'},{'image':'pictures/Yveltal.png'}];
}

function JSONCtrl($scope){
	var data = $scope.dataSet = $.getJSON("artwork.json", function(data){
		console.log(data);
	})
	$scope.info = "hello";
	var infos = $scope.infos = $.parseJSON(data);

}
